import {request} from '@utils/gmall';
import {attrInfoListType, category1ListType, category2ListType, category3ListType} from '@api/project/model/attrType';

//请求一级分类列表
export const reqCategory1List = () =>{
  return request.get<any,category1ListType>(`/admin/product/getCategory1`)
}
//请求二级分类列表
export const reqCategory2List = (category1Id:number) => {
  return request.get<any,category2ListType>(`/admin/product/getCategory2/${category1Id}`)
}
//请求三级分类列表
export const reqCategory3List = (category2Id:number) => {
  return request.get<any,category3ListType>(`/admin/product/getCategory3/${category2Id}`)
}
//请求属性信息列表数据
export interface reqAttrInfoListParams{
  category1Id:number,
  category2Id:number,
  category3Id:number
}
export const reqAttrInfoList = ({
  category1Id,
  category2Id,
  category3Id}:reqAttrInfoListParams) => {
  return request.get<any,attrInfoListType>(`/admin/product/attrInfoList/${category1Id}/${category2Id}/${category3Id}`)
}

